#!/bin/bash

# 打印logo和描述信息
logo=$(cat <<'EOF'
 _____           _                  _                       _  __ _
|  __ \         | |                | |                     (_)/ _(_)
| |__) | __ ___ | |_ ___   ___ ___ | |  ___ _ __   ___  ___ _| |_ _  ___
|  ___/ '__/ _ \| __/ _ \ / __/ _ \| | / __| '_ \ / _ \/ __| |  _| |/ __|
| |   | | | (_) | || (_) | (_| (_) | | \__ \ |_) |  __/ (__| | | | | (__
|_|   |_|  \___/ \__\___/ \___\___/|_| |___/ .__/ \___|\___|_|_| |_|\___|                                                  | |
                                           |_|
       _   _             _
      | | | |           | |                                                       __ _| |_| |_ __ _  ___| | __                                                   / _` | __| __/ _` |/ __| |/ /
| (_| | |_| || (_| | (__|   <
 \__,_|\__|\__\__,_|\___|_|\_\
EOF
)
echo -e "$logo"
echo -e "\033[1;32;40m[*] Protocol-specific attacks are those that target specific protocols, typically involving network communication protocols. These protocols dictate how data is transmitted over the network, including data encapsulation and control information during transmission.\033[1;37;40m"

# Define file dictionary
declare -A files
files=(
       ["1"]="ddos/Protocol_specific_attack/Minecraft_Protocol_Attacks.py"
       ["2"]="ddos/Protocol_specific_attack/SSDP_attack.py"
)

# Create a menu using whiptail
while true; do
       choice=$(whiptail --title "Protocol-Specific Attack Types" --menu "Protocol-specific attacks are those that target specific protocols, typically involving network communication protocols. These protocols dictate how data is transmitted over the network, including data encapsulation and control information during transmission.\n\nPlease select an attack type:" 35 78 20 \
       "1" "Minecraft Protocol Attacks" \
       "2" "SSDP Attack" \
       "0" "Back" \
       3>&1 1>&2 2>&3)

       if [[ $? -eq 0 ]]; then
           if [[ "$choice" == "0" ]]; then
               echo "Operation cancelled."
               break
           else
               python3 "${files[$choice]}"
               break
           fi
       else
           echo "Operation cancelled."
           break
       fi
done
